home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / index.arc / AEMRKOPE.BAS < prev    next >
BASIC Source File  |  1987-01-11  |  1KB  |  40 lines

  1. rem $linesize:132
  2. rem $title:'Application Engineer Standard Routines'
  3. rem $subtitle:'Mark the status flag on a file to OPEN'
  4. '                Include the COMMON values
  5. rem $include:'AESHARED.BAS'            
  6.     
  7. sub Mark.File.Open(fl%,rlen%) static
  8.  
  9.         field #fl%,1 as stat$,2 as n.av$,2 as l.av$,1 as mj$,1 as mn$,1 as bug.fix$
  10.         field #fl%,8 as dummy$,r% as filler$
  11.  
  12. '  stat$    =  Status (1 = Open / 2 = Closed)
  13. '  n.av$    =  Next available record
  14. '  l.av$    =  Last available record
  15. '  mj$      =  Application Engineer Major release version
  16. '  mn$      =  Application Engineer Minor release version
  17. '  bug.fix$ =  Bug fix code within Minor release
  18.  
  19.         get #fl%,1%
  20.  
  21.         if mj$<>chr$(0%) or _
  22.             mn$<>chr$(0%) or _
  23.             bug.fix$<>"B" _
  24.         then
  25.             call ae.error("MFO Version mismatch error. Action 01")
  26.         end if
  27.  
  28.         st%=asc(stat$)
  29.  
  30.  
  31.         if st%=2% then                   '  File is closed, lets open
  32.             lset stat$=chr$(1%)           '  Value for file OPEN
  33.             put #fl%,1%
  34.         elseif st%=1% then               ' File is open ! Probably corrupt
  35.             call ae.error("MFO File not previously closed properly. Action 05")
  36.         else                             ' Corrupt through other means
  37.             call ae.error("MFO File is corrupt. Action 06")
  38.         end if
  39.     end sub
  40.